
import {INCREMENT,DECREMENT} from '../constant';
const initState=0
export default function countReducer(preState=initState,action){
    console.log('count reducer');
    const {type,data}=action
    console.log(type,data)//@@redux/INITi.g.d.2.1.u undefined   初始化的时候type是@@INitxxx的结构
    console.log(preState);
    switch (type) {
        case INCREMENT:
            return preState+data
        case DECREMENT : 
            return preState-data 
        default:
            return preState
    }
}